package study.rabbitmq.consumer.delay;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
import study.rabbitmq.consumer.config.RabbitConfig;

/**
 * 监听延时消息
 */
@Component
@RabbitListener(queues = RabbitConfig.TTL_QUEUE)
public class ConsumerDelayMsg {

    @RabbitHandler
    public void receiveDelayMsg(String msg) {
        System.out.println(this.getClass().getSimpleName()+"ttl:"+msg);
    }

}
